package br.com.beautycenter.view;

import br.com.beautycenter.Funcionalidades.Data;
import br.com.beautycenter.Funcionalidades.Swing;
import br.com.beautycenter.Funcionalidades.Validacoes;
import br.com.beautycenter.DAO.PersisteExameFisico;
import br.com.beautycenter.bean.ExameFisico;
import br.com.beautycenter.bean.Cliente;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

public class CadastroExameFisico extends javax.swing.JDialog {
    
    CadastroCliente cadastroPaciente;
    static List<ExameFisico> listaExames = new ArrayList<ExameFisico>();
    
    Cliente cliente = new Cliente();
    ExameFisico exameFisico = new ExameFisico();
    
    PersisteExameFisico persisteExame = new PersisteExameFisico();
    
    int posicao = -1;
    int operacao = -1;
    /**
     * Inicialmente os botões ativos serão: <br/> btnNovo<br/> btnEditar<br/>
     * btnPesquisar<br/> btnSair<br/>
     */
    public void ativarBotoesIniciar() {
        Swing.desativarCampos(jPanelBotoes.getComponents());
        configuracoesIniciaisDados();
        
        //se a lista estiver vazia, cria um novo
        if (listaExames.isEmpty()) {
            novo();
            btnCancelar.setEnabled(false);
        } else if (posicao < 0) {
            btnNovo.setEnabled(true);
            btnPesquisar.setEnabled(true);
            btnSair.setEnabled(true);
        } else {
            btnNovo.setEnabled(true);
            btnPesquisar.setEnabled(true);
            btnSair.setEnabled(true);
            btnEditar.setEnabled(true);
            btnExcluir.setEnabled(true);
        }
    }
    
    /**
     * Quanto clicar em Novo ou Editar ativará os botões: <br/> btnSalvar<br/>
     * btnCancelar<br/> btnSair<br/>
     */
    public void ativarBotoesNovoEditarExcluir() {
        Swing.desativarCampos(jPanelBotoes.getComponents());
        btnSalvar.setEnabled(true);
        btnCancelar.setEnabled(true);
        btnSair.setEnabled(true);
    }

    public void limparCampos() {
        Swing.zerarCampos(jPanelPaciente.getComponents());
        Swing.zerarCampos(jPanelRestricoes.getComponents());
        
        jDateCadastro.setDate(new Date());
        txtNomePaciente.setText(cliente.getNome());
        
    }

        public void desativarCampos() {
        Swing.desativarCampos(jPanelPaciente.getComponents());
        Swing.desativarCampos(jPanelRestricoes.getComponents());
    }

    public void ativarCampos() {
        Swing.ativarCampos(jPanelPaciente.getComponents());
        Swing.ativarCampos(jPanelRestricoes.getComponents());
        
        txtNomePaciente.setEnabled(false);
    }

    public void inicializarTela() {
        
        cliente = DadosCliente.cliente;
        listaExames = cliente.getListaExamesFisicos();
        
        limparCampos();
        txtNomePaciente.setText(cliente.getNome());
        jDateCadastro.setDate(new Date());
        desativarCampos();
        ativarBotoesIniciar();
    }

    public void novo() {
        operacao = 0;
        limparCampos(); //limpa os dados
        ativarCampos();//ativa os campos
        ativarBotoesNovoEditarExcluir();

        //cria um novo funcionário
        //OBS: é ideia colocar o idExameFisico(0), pois caso cadastrar mais de um exame na mesma sessão, não vai da pau.
        exameFisico = new ExameFisico();
        exameFisico.setIdExameFisico(0);

        jDateCadastro.requestFocus();
    }

    /**
     * Deixa a tela preparada para a atualização de um funcionário
     */
    public void editar() {
        operacao = 1;
        exibirExame();
        ativarCampos();
        ativarBotoesNovoEditarExcluir();

        exameFisico = new ExameFisico();
        exameFisico = listaExames.get(posicao);

        jDateCadastro.requestFocus();
    }

    /**
     * Trava a tela e exibe o paciente que estava antes
     */
    public void cancelar() {
        ativarBotoesIniciar();
        if (posicao < 0) {
            limparCampos();
        } else {
            exibirExame();
        }

        desativarCampos();
    }
    
    public void salvar(){
        if(salvarFormulario()){
            operacao = -1;
            limparCampos();
            desativarCampos();
            ativarBotoesIniciar();
        }
        
    }
    
    
    /**
     * `Remove o perfil da lista e atualiza o paciente.
     */
    public void excluir(){
        exameFisico = listaExames.get(posicao);
        exameFisico = persisteExame.retornarExamePeloId(exameFisico);
        try{
            persisteExame.deletar(exameFisico);
            listaExames.remove(posicao);
        }catch(Exception ex){
            System.out.println("ex: " + ex.getMessage());
            ex.printStackTrace();
        }
        
        posicao = -1;
        limparCampos();
        desativarCampos();
        ativarBotoesIniciar();
    }

    public void configuracoesIniciaisDados() {
        jRArritimiaSim.setSelected(true);
        txtArritimias.setText("");
        
        jRMiocardiopatiaSim.setSelected(true);
        txtMiocardiopatias.setText("");
        
        jRCardiopCongenitaSim.setSelected(true);
        txtCardiopCongenitas.setText("");
        
        jRAsmaBronquiteSim.setSelected(true);
        txtAsmaBronquite.setText("");
        
        jRGastriteUlceraSim.setSelected(true);
        txtGastriteUlcera.setText("");
        
        jRDiabeteSim.setSelected(true);
        txtDiabetes.setText("");
        
        jRHipotiroidismoSim.setSelected(true);
        txtHipotiroidismo.setText("");
        
        jRHipertireodismoSim.setSelected(true);
        txtHipertireodismo.setText("");
        
        jRTromboseSim.setSelected(true);
        txtTrombose.setText("");
        
        jRHemorragiaSim.setSelected(true);
        txtHemorragias.setText("");
        
        jRAnemiaSim.setSelected(true);
        txtAnemia.setText("");
        
        jRCoagulopatiaSim.setSelected(true);
        txtCoagulopatias.setText("");
        
        jRMicoseAfeccaoCutaneaSim.setSelected(true);
        txtMicoses.setText("");
        
        jRCirurgiaPreviaSim.setSelected(true);
        txtCirurgiaPrevia.setText("");
        
        jRAlergiaSim.setSelected(true);
        txtAlergias.setText("");
        
        jRTabagismoSim.setSelected(true);
        txtTabagismo.setText("");
        
        jREtilismoSim.setSelected(true);
        txtEtilismo.setText("");
        
        jRMedicacaoSim.setSelected(true);
        txtMedicacoes.setText("");
        
        jRAtividadeFisicaSim.setSelected(true);
        txtAtividadesFisicas.setText("");
    }
    
    public void exibirExame() {
        jDateCadastro.setDate(listaExames.get(posicao).getDtCadastro());
        
        jRArritimiaSim.setSelected(listaExames.get(posicao).isArritimias());
        jRArritimiaNao.setSelected(!listaExames.get(posicao).isArritimias());
        txtArritimias.setText(listaExames.get(posicao).getTipoArritimia());
        
        jRMiocardiopatiaSim.setSelected(listaExames.get(posicao).isMiocardiopatias());
        jRMiocardiopatiaNao.setSelected(!listaExames.get(posicao).isMiocardiopatias());
        txtMiocardiopatias.setText(listaExames.get(posicao).getTipoMiocardiopatia());
        
        jRCardiopCongenitaSim.setSelected(listaExames.get(posicao).isCardiopCongenitas());
        jRCardiopCongenitaNao.setSelected(!listaExames.get(posicao).isCardiopCongenitas());
        txtCardiopCongenitas.setText(listaExames.get(posicao).getTipoCardiopCongenitas());
        
        jRAsmaBronquiteSim.setSelected(listaExames.get(posicao).isAsmaBronquite());
        jRAsmaBronquiteNao.setSelected(!listaExames.get(posicao).isAsmaBronquite());
        txtAsmaBronquite.setText(listaExames.get(posicao).getTipoAsmaBronquite());
        
        jRGastriteUlceraSim.setSelected(listaExames.get(posicao).isGastriteUlcera());
        jRGastriteUlceraNao.setSelected(!listaExames.get(posicao).isGastriteUlcera());
        txtGastriteUlcera.setText(listaExames.get(posicao).getTipoGastrite());
        
        jRDiabeteSim.setSelected(listaExames.get(posicao).isDiabetes());
        jRDiabeteNao.setSelected(!listaExames.get(posicao).isDiabetes());
        txtDiabetes.setText(listaExames.get(posicao).getTipoDiabetes());
        
        jRHipotiroidismoSim.setSelected(listaExames.get(posicao).isHipotiroidismo());
        jRHipotiroidismoNao.setSelected(!listaExames.get(posicao).isHipotiroidismo());
        txtHipotiroidismo.setText(listaExames.get(posicao).getTipoHipotiroidismo());
        
        jRHipertireodismoSim.setSelected(listaExames.get(posicao).isHipertireodismo());
        jRHipertireodismoNao.setSelected(!listaExames.get(posicao).isHipertireodismo());
        txtHipertireodismo.setText(listaExames.get(posicao).getTipoHipertireodismo());
        
        jRTromboseSim.setSelected(listaExames.get(posicao).isTrombose());
        jRTromboseNao.setSelected(!listaExames.get(posicao).isTrombose());
        txtTrombose.setText(listaExames.get(posicao).getTipoTrombose());
        
        jRHemorragiaSim.setSelected(listaExames.get(posicao).isHemorragias());
        jRHemorragiaNao.setSelected(!listaExames.get(posicao).isHemorragias());
        txtHemorragias.setText(listaExames.get(posicao).getTipoHemorragia());
        
        jRAnemiaSim.setSelected(listaExames.get(posicao).isAnemia());
        jRAnemiaNao.setSelected(!listaExames.get(posicao).isAnemia());
        txtAnemia.setText(listaExames.get(posicao).getTipoAnemia());
        
        jRCoagulopatiaSim.setSelected(listaExames.get(posicao).isCoagulopatias());
        jRCoagulopatiaNao.setSelected(!listaExames.get(posicao).isCoagulopatias());
        txtCoagulopatias.setText(listaExames.get(posicao).getTipoCoagulopatia());
        
        jRMicoseAfeccaoCutaneaSim.setSelected(listaExames.get(posicao).isMicosesAfeccoesCutaneas());
        jRMicoseAfeccaoCutaneaNao.setSelected(!listaExames.get(posicao).isMicosesAfeccoesCutaneas());
        txtMicoses.setText(listaExames.get(posicao).getTipoMicose());
        
        jRCirurgiaPreviaSim.setSelected(listaExames.get(posicao).isCirurgiaPrevia());
        jRCirurgiaPreviaNao.setSelected(!listaExames.get(posicao).isCirurgiaPrevia());
        txtCirurgiaPrevia.setText(listaExames.get(posicao).getTipoCirurgia());
        
        jRAlergiaSim.setSelected(listaExames.get(posicao).isAlergia());
        jRAlergiaNao.setSelected(!listaExames.get(posicao).isAlergia());
        txtAlergias.setText(listaExames.get(posicao).getTipoAlergia());
        
        jRTabagismoSim.setSelected(listaExames.get(posicao).isTabagismo());
        jRTabagismoNao.setSelected(!listaExames.get(posicao).isTabagismo());
        txtTabagismo.setText(listaExames.get(posicao).getTipoTabagismo());
        
        jREtilismoSim.setSelected(listaExames.get(posicao).isEtilismo());
        jREtilismoNao.setSelected(!listaExames.get(posicao).isEtilismo());
        txtEtilismo.setText(listaExames.get(posicao).getTipoEtilismo());
        
        jRMedicacaoSim.setSelected(listaExames.get(posicao).isMedicacoes());
        jRMedicacaoNao.setSelected(!listaExames.get(posicao).isMedicacoes());
        txtMedicacoes.setText(listaExames.get(posicao).getTipoMedicacoes());
        
        jRAtividadeFisicaSim.setSelected(listaExames.get(posicao).isAtividadesFisicas());
        jRAtividadeFisicaNao.setSelected(!listaExames.get(posicao).isAtividadesFisicas());
        txtAtividadesFisicas.setText(listaExames.get(posicao).getTipoAtividadeFisica());
    }
    
    public void preencherExameFisico() {
        exameFisico.setArritimias(jRArritimiaSim.isSelected());
        exameFisico.setTipoArritimia(txtArritimias.getText().trim());
        
        exameFisico.setMiocardiopatias(jRMiocardiopatiaSim.isSelected());
        exameFisico.setTipoMiocardiopatia(txtMiocardiopatias.getText().trim());
        
        exameFisico.setCardiopCongenitas(jRCardiopCongenitaSim.isSelected());
        exameFisico.setTipoCardiopCongenitas(txtCardiopCongenitas.getText().trim());
        
        exameFisico.setAsmaBronquite(jRAsmaBronquiteSim.isSelected());
        exameFisico.setTipoAsmaBronquite(txtAsmaBronquite.getText().trim());
        
        exameFisico.setGastriteUlcera(jRGastriteUlceraSim.isSelected());
        exameFisico.setTipoGastrite(txtGastriteUlcera.getText().trim());
        
        exameFisico.setDiabetes(jRDiabeteSim.isSelected());
        exameFisico.setTipoDiabetes(txtDiabetes.getText().trim());
        
        exameFisico.setHipotiroidismo(jRHipotiroidismoSim.isSelected());
        exameFisico.setTipoHipotiroidismo(txtHipotiroidismo.getText().trim());
        
        exameFisico.setHipertireodismo(jRHipertireodismoSim.isSelected());
        exameFisico.setTipoHipertireodismo(txtHipertireodismo.getText().trim());
        
        exameFisico.setTrombose(jRTromboseSim.isSelected());
        exameFisico.setTipoTrombose(txtTrombose.getText().trim());
        
        exameFisico.setHemorragias(jRHemorragiaSim.isSelected());
        exameFisico.setTipoHemorragia(txtHemorragias.getText().trim());
        
        exameFisico.setAnemia(jRAnemiaSim.isSelected());
        exameFisico.setTipoAnemia(txtAnemia.getText().trim());
        
        exameFisico.setCoagulopatias(jRCoagulopatiaSim.isSelected());
        exameFisico.setTipoCoagulopatia(txtCoagulopatias.getText().trim());
        
        exameFisico.setMicosesAfeccoesCutaneas(jRMicoseAfeccaoCutaneaSim.isSelected());
        exameFisico.setTipoMicose(txtMicoses.getText().trim());
        
        exameFisico.setCirurgiaPrevia(jRCirurgiaPreviaSim.isSelected());
        exameFisico.setTipoCirurgia(txtCirurgiaPrevia.getText().trim());
        
        exameFisico.setAlergia(jRAlergiaSim.isSelected());
        exameFisico.setTipoAlergia(txtAlergias.getText().trim());
        
        exameFisico.setTabagismo(jRTabagismoSim.isSelected());
        exameFisico.setTipoTabagismo(txtTabagismo.getText().trim());
        
        exameFisico.setEtilismo(jREtilismoSim.isSelected());
        exameFisico.setTipoEtilismo(txtEtilismo.getText().trim());
        
        exameFisico.setMedicacoes(jRMedicacaoSim.isSelected());
        exameFisico.setTipoMedicacoes(txtMedicacoes.getText().trim());
        
        exameFisico.setAtividadesFisicas(jRAtividadeFisicaSim.isSelected());
        exameFisico.setTipoAtividadeFisica(txtAtividadesFisicas.getText().trim());
    }

    public boolean validarDataConsulta() {
        if (Validacoes.validarData(jDateCadastro.getDate(), true)) {
            exameFisico.setDtCadastro(jDateCadastro.getDate());
            return true;
        } else {
            JOptionPane.showMessageDialog(null, "Preencha o campo data corretamente. Ele não pode estar vazio ou ser maior que a "
                    + "data atual.");
            jDateCadastro.requestFocus();
            return false;
        }
    }
    
    public boolean salvarFormulario() {
        if(validarDataConsulta()){
            preencherExameFisico();
            exameFisico.setPaciente(cliente);

            if(operacao == 0){
                persisteExame.salvar(exameFisico);
                listaExames.add(exameFisico);
            }else if(operacao == 1){
                persisteExame.atualizar(exameFisico);
            }
            
            return true;
        }
        return false;
        
    }
    
    public void pesquisar(){
        if(!listaExames.isEmpty()){
            selecionarPerfil();
            ativarBotoesIniciar();
            exibirExame();
        }else{
            JOptionPane.showMessageDialog(null, "Não existe um perfil antropométrico cadastrado para esse funcionário.");
        }
    }
    
    /**
     * Cria uma janela de confirmação contendo uma label e um combobox. Nesse combobox ficarão as datas de cadastro dos perfis.
     * O Objetivo e retornar e exibir o perfil procurado
     */
    public void selecionarPerfil(){
        JLabel label = new JLabel("Data do exame:");
        JComboBox combo = new JComboBox();
        Object[] objetos = new Object[]{label, combo};
        
        //preenchendo o combo com os valores da lista
        for(ExameFisico item: listaExames){
            combo.addItem(Data.formatoDataConvencional.format(item.getDtCadastro()));
        }
        
        //exibe a mensagem na tela e pega a resposta
        int resposta = JOptionPane.showConfirmDialog(null, objetos, 
                "Selecione um exame físico pela sua data de cadastro", JOptionPane.OK_CANCEL_OPTION);
        
        //se a resposta for ok, retorna o perfil desejado.
        if(resposta == JOptionPane.OK_OPTION){
            posicao = combo.getSelectedIndex();
            desativarCampos();
        }
    }
    
    /**
     * Caso o radioSim esteja selecionado o campo texto correspondente é ativado.
     * @param radio
     * @param campo 
     */
    public void ativarCampo(JRadioButton radio, JTextField campo){
        if(!radio.isSelected()){
            campo.setEnabled(false);
            campo.setText("");
        }else{
            campo.setEnabled(true);
        }
    }
    
    /**
     * Creates new form CadastroExameFisico
     */
    public CadastroExameFisico(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        inicializarTela();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        buttonGroup5 = new javax.swing.ButtonGroup();
        buttonGroup6 = new javax.swing.ButtonGroup();
        buttonGroup7 = new javax.swing.ButtonGroup();
        buttonGroup8 = new javax.swing.ButtonGroup();
        buttonGroup9 = new javax.swing.ButtonGroup();
        buttonGroup10 = new javax.swing.ButtonGroup();
        buttonGroup11 = new javax.swing.ButtonGroup();
        buttonGroup12 = new javax.swing.ButtonGroup();
        buttonGroup13 = new javax.swing.ButtonGroup();
        buttonGroup14 = new javax.swing.ButtonGroup();
        buttonGroup15 = new javax.swing.ButtonGroup();
        buttonGroup16 = new javax.swing.ButtonGroup();
        buttonGroup17 = new javax.swing.ButtonGroup();
        buttonGroup18 = new javax.swing.ButtonGroup();
        buttonGroup19 = new javax.swing.ButtonGroup();
        jPanelPrincipal = new javax.swing.JPanel();
        jPanelBotoes = new javax.swing.JPanel();
        btnNovo = new javax.swing.JButton();
        btnEditar = new javax.swing.JButton();
        btnExcluir = new javax.swing.JButton();
        btnPesquisar = new javax.swing.JButton();
        btnSalvar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        btnSair = new javax.swing.JButton();
        jPanelPaciente = new javax.swing.JPanel();
        jLabelPaciente = new javax.swing.JLabel();
        txtNomePaciente = new javax.swing.JTextField();
        jDateCadastro = new com.toedter.calendar.JDateChooser();
        jLabel1 = new javax.swing.JLabel();
        jPanelRestricoes = new javax.swing.JPanel();
        jLabelArritimia = new javax.swing.JLabel();
        jRArritimiaSim = new javax.swing.JRadioButton();
        jRArritimiaNao = new javax.swing.JRadioButton();
        jLabelMiocardiopatia = new javax.swing.JLabel();
        jRMiocardiopatiaSim = new javax.swing.JRadioButton();
        jRMiocardiopatiaNao = new javax.swing.JRadioButton();
        jLabelCardiopCongenta = new javax.swing.JLabel();
        jRCardiopCongenitaSim = new javax.swing.JRadioButton();
        jRCardiopCongenitaNao = new javax.swing.JRadioButton();
        jLabelAsmaBronquite = new javax.swing.JLabel();
        jRAsmaBronquiteSim = new javax.swing.JRadioButton();
        jRAsmaBronquiteNao = new javax.swing.JRadioButton();
        jLabel3 = new javax.swing.JLabel();
        jRGastriteUlceraSim = new javax.swing.JRadioButton();
        jRGastriteUlceraNao = new javax.swing.JRadioButton();
        txtGastriteUlcera = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jRDiabeteSim = new javax.swing.JRadioButton();
        jRDiabeteNao = new javax.swing.JRadioButton();
        jRHipotiroidismoNao = new javax.swing.JRadioButton();
        jRHipotiroidismoSim = new javax.swing.JRadioButton();
        jLabelHipotiroidismo = new javax.swing.JLabel();
        jLabelHipertireoidismo = new javax.swing.JLabel();
        jRHipertireodismoSim = new javax.swing.JRadioButton();
        jRHipertireodismoNao = new javax.swing.JRadioButton();
        jRTromboseNao = new javax.swing.JRadioButton();
        jLabelTrombose = new javax.swing.JLabel();
        jRTromboseSim = new javax.swing.JRadioButton();
        jLabel10 = new javax.swing.JLabel();
        jRHemorragiaSim = new javax.swing.JRadioButton();
        jRHemorragiaNao = new javax.swing.JRadioButton();
        jLabelAnemia = new javax.swing.JLabel();
        jRAnemiaSim = new javax.swing.JRadioButton();
        jRAnemiaNao = new javax.swing.JRadioButton();
        jLabelCoagulopatia = new javax.swing.JLabel();
        jRCoagulopatiaSim = new javax.swing.JRadioButton();
        jRCoagulopatiaNao = new javax.swing.JRadioButton();
        jLabelMicosesAfeccoesCutaneas = new javax.swing.JLabel();
        jRMicoseAfeccaoCutaneaSim = new javax.swing.JRadioButton();
        jRMicoseAfeccaoCutaneaNao = new javax.swing.JRadioButton();
        jLabelCirurgiaPrevia = new javax.swing.JLabel();
        jRCirurgiaPreviaSim = new javax.swing.JRadioButton();
        jRCirurgiaPreviaNao = new javax.swing.JRadioButton();
        jLabelAlergia = new javax.swing.JLabel();
        jRAlergiaSim = new javax.swing.JRadioButton();
        jRAlergiaNao = new javax.swing.JRadioButton();
        jLabel18 = new javax.swing.JLabel();
        jRTabagismoSim = new javax.swing.JRadioButton();
        jRTabagismoNao = new javax.swing.JRadioButton();
        jLabelEtilismo = new javax.swing.JLabel();
        jREtilismoSim = new javax.swing.JRadioButton();
        jREtilismoNao = new javax.swing.JRadioButton();
        jLabelMedicacao = new javax.swing.JLabel();
        jRMedicacaoNao = new javax.swing.JRadioButton();
        jRAtividadeFisicaSim = new javax.swing.JRadioButton();
        jLabel20 = new javax.swing.JLabel();
        jRMedicacaoSim = new javax.swing.JRadioButton();
        jRAtividadeFisicaNao = new javax.swing.JRadioButton();
        txtAsmaBronquite = new javax.swing.JTextField();
        txtArritimias = new javax.swing.JTextField();
        txtCardiopCongenitas = new javax.swing.JTextField();
        txtMiocardiopatias = new javax.swing.JTextField();
        txtDiabetes = new javax.swing.JTextField();
        txtTrombose = new javax.swing.JTextField();
        txtHipotiroidismo = new javax.swing.JTextField();
        txtHipertireodismo = new javax.swing.JTextField();
        txtHemorragias = new javax.swing.JTextField();
        txtCoagulopatias = new javax.swing.JTextField();
        txtAnemia = new javax.swing.JTextField();
        txtCirurgiaPrevia = new javax.swing.JTextField();
        txtMicoses = new javax.swing.JTextField();
        txtTabagismo = new javax.swing.JTextField();
        txtAlergias = new javax.swing.JTextField();
        txtMedicacoes = new javax.swing.JTextField();
        txtEtilismo = new javax.swing.JTextField();
        txtAtividadesFisicas = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("ERP BEAUTY CENTER - Cadastro de exame fisico");
        setResizable(false);

        jPanelPrincipal.setPreferredSize(new java.awt.Dimension(800, 600));

        jPanelBotoes.setMinimumSize(new java.awt.Dimension(800, 45));
        jPanelBotoes.setPreferredSize(new java.awt.Dimension(800, 45));

        btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Novo.png"))); // NOI18N
        btnNovo.setToolTipText("NOVO");
        btnNovo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNovoActionPerformed(evt);
            }
        });

        btnEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Editar.png"))); // NOI18N
        btnEditar.setToolTipText("ALTERAR");
        btnEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarActionPerformed(evt);
            }
        });

        btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Excluir.png"))); // NOI18N
        btnExcluir.setToolTipText("EXCLUIR");
        btnExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExcluirActionPerformed(evt);
            }
        });

        btnPesquisar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Pesquisar.png"))); // NOI18N
        btnPesquisar.setToolTipText("PESQUISAR");
        btnPesquisar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPesquisarActionPerformed(evt);
            }
        });

        btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Salvar.png"))); // NOI18N
        btnSalvar.setToolTipText("SALVAR");
        btnSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalvarActionPerformed(evt);
            }
        });

        btnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Cancelar.png"))); // NOI18N
        btnCancelar.setToolTipText("CANCELAR");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });

        btnSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/beautycenter/img/Sair.png"))); // NOI18N
        btnSair.setToolTipText("SAIR");
        btnSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSairActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBotoesLayout = new javax.swing.GroupLayout(jPanelBotoes);
        jPanelBotoes.setLayout(jPanelBotoesLayout);
        jPanelBotoesLayout.setHorizontalGroup(
            jPanelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 800, Short.MAX_VALUE)
            .addGroup(jPanelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelBotoesLayout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(btnNovo)
                    .addGap(5, 5, 5)
                    .addComponent(btnEditar)
                    .addGap(5, 5, 5)
                    .addComponent(btnExcluir)
                    .addGap(5, 5, 5)
                    .addComponent(btnPesquisar)
                    .addGap(5, 5, 5)
                    .addComponent(btnSalvar)
                    .addGap(5, 5, 5)
                    .addComponent(btnCancelar)
                    .addGap(5, 5, 5)
                    .addComponent(btnSair)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );
        jPanelBotoesLayout.setVerticalGroup(
            jPanelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 45, Short.MAX_VALUE)
            .addGroup(jPanelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelBotoesLayout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addGroup(jPanelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(btnNovo)
                        .addComponent(btnEditar)
                        .addComponent(btnExcluir)
                        .addComponent(btnPesquisar)
                        .addComponent(btnSalvar)
                        .addComponent(btnCancelar)
                        .addComponent(btnSair))
                    .addGap(0, 0, Short.MAX_VALUE)))
        );

        jPanelPaciente.setBackground(new java.awt.Color(255, 255, 255));
        jPanelPaciente.setPreferredSize(new java.awt.Dimension(800, 70));

        jLabelPaciente.setText("Paciente:");

        jLabel1.setText("Data Cadastro:");

        javax.swing.GroupLayout jPanelPacienteLayout = new javax.swing.GroupLayout(jPanelPaciente);
        jPanelPaciente.setLayout(jPanelPacienteLayout);
        jPanelPacienteLayout.setHorizontalGroup(
            jPanelPacienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPacienteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelPacienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(jLabelPaciente))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPacienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtNomePaciente, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jDateCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(312, Short.MAX_VALUE))
        );
        jPanelPacienteLayout.setVerticalGroup(
            jPanelPacienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPacienteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelPacienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPaciente)
                    .addComponent(txtNomePaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPacienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(jDateCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        jPanelRestricoes.setBackground(new java.awt.Color(255, 255, 255));
        jPanelRestricoes.setPreferredSize(new java.awt.Dimension(800, 600));

        jLabelArritimia.setText("POSSUI ARRITMIAS?");

        jRArritimiaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(jRArritimiaSim);
        jRArritimiaSim.setSelected(true);
        jRArritimiaSim.setText("SIM");
        jRArritimiaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRArritimiaSimItemStateChanged(evt);
            }
        });

        jRArritimiaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(jRArritimiaNao);
        jRArritimiaNao.setText("NÃO");

        jLabelMiocardiopatia.setText("POSSUI MIOCARDIOPATIAS?");

        jRMiocardiopatiaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(jRMiocardiopatiaSim);
        jRMiocardiopatiaSim.setSelected(true);
        jRMiocardiopatiaSim.setText("SIM");
        jRMiocardiopatiaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRMiocardiopatiaSimItemStateChanged(evt);
            }
        });

        jRMiocardiopatiaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup2.add(jRMiocardiopatiaNao);
        jRMiocardiopatiaNao.setText("NÃO");

        jLabelCardiopCongenta.setText("POSSUI CARDIOP. CONGÊNITAS?");

        jRCardiopCongenitaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup3.add(jRCardiopCongenitaSim);
        jRCardiopCongenitaSim.setSelected(true);
        jRCardiopCongenitaSim.setText("SIM");
        jRCardiopCongenitaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRCardiopCongenitaSimItemStateChanged(evt);
            }
        });

        jRCardiopCongenitaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup3.add(jRCardiopCongenitaNao);
        jRCardiopCongenitaNao.setText("NÃO");

        jLabelAsmaBronquite.setText("POSSUI ASMA/BRONQUITE?");

        jRAsmaBronquiteSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup4.add(jRAsmaBronquiteSim);
        jRAsmaBronquiteSim.setSelected(true);
        jRAsmaBronquiteSim.setText("SIM");
        jRAsmaBronquiteSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRAsmaBronquiteSimItemStateChanged(evt);
            }
        });

        jRAsmaBronquiteNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup4.add(jRAsmaBronquiteNao);
        jRAsmaBronquiteNao.setText("NÃO");

        jLabel3.setText("POSSUI GASTRITE OU ÚLCERA?");

        jRGastriteUlceraSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup5.add(jRGastriteUlceraSim);
        jRGastriteUlceraSim.setSelected(true);
        jRGastriteUlceraSim.setText("SIM");
        jRGastriteUlceraSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRGastriteUlceraSimItemStateChanged(evt);
            }
        });

        jRGastriteUlceraNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup5.add(jRGastriteUlceraNao);
        jRGastriteUlceraNao.setText("NÃO");

        jLabel7.setText("POSSUI DIABETES?");

        jRDiabeteSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup6.add(jRDiabeteSim);
        jRDiabeteSim.setSelected(true);
        jRDiabeteSim.setText("SIM");
        jRDiabeteSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRDiabeteSimItemStateChanged(evt);
            }
        });

        jRDiabeteNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup6.add(jRDiabeteNao);
        jRDiabeteNao.setText("NÃO");

        jRHipotiroidismoNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup7.add(jRHipotiroidismoNao);
        jRHipotiroidismoNao.setText("NÃO");

        jRHipotiroidismoSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup7.add(jRHipotiroidismoSim);
        jRHipotiroidismoSim.setSelected(true);
        jRHipotiroidismoSim.setText("SIM");
        jRHipotiroidismoSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRHipotiroidismoSimItemStateChanged(evt);
            }
        });

        jLabelHipotiroidismo.setText("POSSUI HIPOTIROIDISMO?");

        jLabelHipertireoidismo.setText("POSSUI HIPERTIREOIDISMO?");

        jRHipertireodismoSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup8.add(jRHipertireodismoSim);
        jRHipertireodismoSim.setSelected(true);
        jRHipertireodismoSim.setText("SIM");
        jRHipertireodismoSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRHipertireodismoSimItemStateChanged(evt);
            }
        });

        jRHipertireodismoNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup8.add(jRHipertireodismoNao);
        jRHipertireodismoNao.setText("NÃO");

        jRTromboseNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup9.add(jRTromboseNao);
        jRTromboseNao.setText("NÃO");

        jLabelTrombose.setText("POSSUI TROMBOSE?");

        jRTromboseSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup9.add(jRTromboseSim);
        jRTromboseSim.setSelected(true);
        jRTromboseSim.setText("SIM");
        jRTromboseSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRTromboseSimItemStateChanged(evt);
            }
        });

        jLabel10.setText("POSSUI HEMORRAGIAS?");

        jRHemorragiaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup10.add(jRHemorragiaSim);
        jRHemorragiaSim.setSelected(true);
        jRHemorragiaSim.setText("SIM");
        jRHemorragiaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRHemorragiaSimItemStateChanged(evt);
            }
        });

        jRHemorragiaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup10.add(jRHemorragiaNao);
        jRHemorragiaNao.setText("NÃO");

        jLabelAnemia.setText("POSSUI ANEMIA?");

        jRAnemiaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup11.add(jRAnemiaSim);
        jRAnemiaSim.setSelected(true);
        jRAnemiaSim.setText("SIM");
        jRAnemiaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRAnemiaSimItemStateChanged(evt);
            }
        });

        jRAnemiaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup11.add(jRAnemiaNao);
        jRAnemiaNao.setText("NÃO");

        jLabelCoagulopatia.setText("POSSUI COAGULOPATIAS?");

        jRCoagulopatiaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup12.add(jRCoagulopatiaSim);
        jRCoagulopatiaSim.setSelected(true);
        jRCoagulopatiaSim.setText("SIM");

        jRCoagulopatiaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup12.add(jRCoagulopatiaNao);
        jRCoagulopatiaNao.setText("NÃO");

        jLabelMicosesAfeccoesCutaneas.setText("POSSUI MICOSES/AFECÇÕES CUTÂNEAS?");

        jRMicoseAfeccaoCutaneaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup13.add(jRMicoseAfeccaoCutaneaSim);
        jRMicoseAfeccaoCutaneaSim.setSelected(true);
        jRMicoseAfeccaoCutaneaSim.setText("SIM");

        jRMicoseAfeccaoCutaneaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup13.add(jRMicoseAfeccaoCutaneaNao);
        jRMicoseAfeccaoCutaneaNao.setText("NÃO");

        jLabelCirurgiaPrevia.setText("POSSUI CIRURGIA PRÉVIA?");

        jRCirurgiaPreviaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup14.add(jRCirurgiaPreviaSim);
        jRCirurgiaPreviaSim.setSelected(true);
        jRCirurgiaPreviaSim.setText("SIM");
        jRCirurgiaPreviaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRCirurgiaPreviaSimItemStateChanged(evt);
            }
        });

        jRCirurgiaPreviaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup14.add(jRCirurgiaPreviaNao);
        jRCirurgiaPreviaNao.setText("NÃO");

        jLabelAlergia.setText("POSSUI ALERGIAS?");

        jRAlergiaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup15.add(jRAlergiaSim);
        jRAlergiaSim.setSelected(true);
        jRAlergiaSim.setText("SIM");
        jRAlergiaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRAlergiaSimItemStateChanged(evt);
            }
        });

        jRAlergiaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup15.add(jRAlergiaNao);
        jRAlergiaNao.setText("NÃO");

        jLabel18.setText("POSSUI TABAGISMO?");

        jRTabagismoSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup16.add(jRTabagismoSim);
        jRTabagismoSim.setSelected(true);
        jRTabagismoSim.setText("SIM");
        jRTabagismoSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRTabagismoSimItemStateChanged(evt);
            }
        });

        jRTabagismoNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup16.add(jRTabagismoNao);
        jRTabagismoNao.setText("NÃO");

        jLabelEtilismo.setText("POSSUI ETILISMO?");

        jREtilismoSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup17.add(jREtilismoSim);
        jREtilismoSim.setSelected(true);
        jREtilismoSim.setText("SIM");
        jREtilismoSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jREtilismoSimItemStateChanged(evt);
            }
        });

        jREtilismoNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup17.add(jREtilismoNao);
        jREtilismoNao.setText("NÃO");

        jLabelMedicacao.setText("POSSUI MEDICAÇÕES?");

        jRMedicacaoNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup18.add(jRMedicacaoNao);
        jRMedicacaoNao.setText("NÃO");

        jRAtividadeFisicaSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup19.add(jRAtividadeFisicaSim);
        jRAtividadeFisicaSim.setSelected(true);
        jRAtividadeFisicaSim.setText("SIM");
        jRAtividadeFisicaSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRAtividadeFisicaSimItemStateChanged(evt);
            }
        });

        jLabel20.setText("REALIZA ATIVIDADES FÍSICAS?");

        jRMedicacaoSim.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup18.add(jRMedicacaoSim);
        jRMedicacaoSim.setSelected(true);
        jRMedicacaoSim.setText("SIM");
        jRMedicacaoSim.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRMedicacaoSimItemStateChanged(evt);
            }
        });

        jRAtividadeFisicaNao.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup19.add(jRAtividadeFisicaNao);
        jRAtividadeFisicaNao.setText("NÃO");

        javax.swing.GroupLayout jPanelRestricoesLayout = new javax.swing.GroupLayout(jPanelRestricoes);
        jPanelRestricoes.setLayout(jPanelRestricoesLayout);
        jPanelRestricoesLayout.setHorizontalGroup(
            jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelArritimia, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelMiocardiopatia, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelCardiopCongenta, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelAsmaBronquite, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelHipotiroidismo, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelHipertireoidismo, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelTrombose, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelAnemia, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelCoagulopatia, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelMicosesAfeccoesCutaneas, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelCirurgiaPrevia, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelAlergia, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel18, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelEtilismo, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelMedicacao, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jRMicoseAfeccaoCutaneaSim)
                    .addComponent(jRCoagulopatiaSim)
                    .addComponent(jRCirurgiaPreviaSim)
                    .addComponent(jRAnemiaSim)
                    .addComponent(jRTabagismoSim)
                    .addComponent(jRAlergiaSim)
                    .addComponent(jREtilismoSim)
                    .addComponent(jRMedicacaoSim)
                    .addComponent(jRAtividadeFisicaSim)
                    .addComponent(jRArritimiaSim)
                    .addComponent(jRMiocardiopatiaSim)
                    .addComponent(jRCardiopCongenitaSim)
                    .addComponent(jRAsmaBronquiteSim)
                    .addComponent(jRGastriteUlceraSim)
                    .addComponent(jRDiabeteSim)
                    .addComponent(jRHipotiroidismoSim)
                    .addComponent(jRHipertireodismoSim)
                    .addComponent(jRTromboseSim)
                    .addComponent(jRHemorragiaSim))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addComponent(jRTabagismoNao)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtTabagismo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addComponent(jRAsmaBronquiteNao)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtAsmaBronquite, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addComponent(jRGastriteUlceraNao)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtGastriteUlcera, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addComponent(jRAtividadeFisicaNao)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtAtividadesFisicas, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jRArritimiaNao)
                            .addComponent(jRMiocardiopatiaNao)
                            .addComponent(jRCardiopCongenitaNao))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtArritimias, javax.swing.GroupLayout.PREFERRED_SIZE, 485, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCardiopCongenitas, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMiocardiopatias, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jRDiabeteNao)
                            .addComponent(jRHipotiroidismoNao)
                            .addComponent(jRHipertireodismoNao)
                            .addComponent(jRTromboseNao)
                            .addComponent(jRHemorragiaNao)
                            .addComponent(jRAnemiaNao))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtTrombose, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtHemorragias, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtDiabetes, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtHipertireodismo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtHipotiroidismo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtAnemia, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jRCoagulopatiaNao)
                            .addComponent(jRMicoseAfeccaoCutaneaNao)
                            .addComponent(jRCirurgiaPreviaNao))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtCoagulopatias, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMicoses, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCirurgiaPrevia, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addComponent(jRAlergiaNao)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtAlergias, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jREtilismoNao)
                            .addComponent(jRMedicacaoNao))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtMedicacoes, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtEtilismo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelRestricoesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtAlergias, txtAnemia, txtArritimias, txtAsmaBronquite, txtAtividadesFisicas, txtCardiopCongenitas, txtCirurgiaPrevia, txtCoagulopatias, txtDiabetes, txtEtilismo, txtGastriteUlcera, txtHemorragias, txtHipertireodismo, txtHipotiroidismo, txtMedicacoes, txtMicoses, txtMiocardiopatias, txtTabagismo, txtTrombose});

        jPanelRestricoesLayout.setVerticalGroup(
            jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRestricoesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelArritimia)
                    .addComponent(jRArritimiaSim)
                    .addComponent(jRArritimiaNao)
                    .addComponent(txtArritimias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelMiocardiopatia)
                    .addComponent(jRMiocardiopatiaSim)
                    .addComponent(jRMiocardiopatiaNao)
                    .addComponent(txtMiocardiopatias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelCardiopCongenta)
                    .addComponent(jRCardiopCongenitaSim)
                    .addComponent(jRCardiopCongenitaNao)
                    .addComponent(txtCardiopCongenitas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelAsmaBronquite)
                    .addComponent(jRAsmaBronquiteSim)
                    .addComponent(jRAsmaBronquiteNao)
                    .addComponent(txtAsmaBronquite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jRGastriteUlceraSim)
                    .addComponent(txtGastriteUlcera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jRGastriteUlceraNao))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jRDiabeteSim)
                    .addComponent(jRDiabeteNao)
                    .addComponent(txtDiabetes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelHipotiroidismo)
                    .addComponent(jRHipotiroidismoSim)
                    .addComponent(jRHipotiroidismoNao)
                    .addComponent(txtHipotiroidismo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelHipertireoidismo)
                    .addComponent(jRHipertireodismoSim)
                    .addComponent(jRHipertireodismoNao)
                    .addComponent(txtHipertireodismo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTrombose)
                    .addComponent(jRTromboseSim)
                    .addComponent(jRTromboseNao)
                    .addComponent(txtTrombose, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jRHemorragiaSim)
                    .addComponent(jRHemorragiaNao)
                    .addComponent(txtHemorragias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelAnemia)
                    .addComponent(jRAnemiaSim)
                    .addComponent(jRAnemiaNao)
                    .addComponent(txtAnemia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelCoagulopatia)
                    .addComponent(jRCoagulopatiaSim)
                    .addComponent(jRCoagulopatiaNao)
                    .addComponent(txtCoagulopatias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelMicosesAfeccoesCutaneas)
                    .addComponent(jRMicoseAfeccaoCutaneaSim)
                    .addComponent(jRMicoseAfeccaoCutaneaNao)
                    .addComponent(txtMicoses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelCirurgiaPrevia)
                    .addComponent(jRCirurgiaPreviaSim)
                    .addComponent(jRCirurgiaPreviaNao)
                    .addComponent(txtCirurgiaPrevia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelAlergia)
                    .addComponent(jRAlergiaSim)
                    .addComponent(jRAlergiaNao)
                    .addComponent(txtAlergias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jRTabagismoSim)
                    .addComponent(jRTabagismoNao)
                    .addComponent(txtTabagismo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelEtilismo)
                    .addComponent(jREtilismoSim)
                    .addComponent(jREtilismoNao)
                    .addComponent(txtEtilismo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelMedicacao)
                    .addComponent(jRMedicacaoSim)
                    .addComponent(jRMedicacaoNao)
                    .addComponent(txtMedicacoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRestricoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jRAtividadeFisicaSim)
                    .addComponent(jRAtividadeFisicaNao)
                    .addComponent(txtAtividadesFisicas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(188, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanelPrincipalLayout = new javax.swing.GroupLayout(jPanelPrincipal);
        jPanelPrincipal.setLayout(jPanelPrincipalLayout);
        jPanelPrincipalLayout.setHorizontalGroup(
            jPanelPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPrincipalLayout.createSequentialGroup()
                .addGroup(jPanelPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelPaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelRestricoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanelPrincipalLayout.setVerticalGroup(
            jPanelPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPrincipalLayout.createSequentialGroup()
                .addComponent(jPanelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelPaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelRestricoes, javax.swing.GroupLayout.PREFERRED_SIZE, 686, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanelPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, 636, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed
        novo();
    }//GEN-LAST:event_btnNovoActionPerformed

    private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed
        editar();
    }//GEN-LAST:event_btnEditarActionPerformed

    private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
        excluir();
    }//GEN-LAST:event_btnExcluirActionPerformed

    private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed
        pesquisar();
    }//GEN-LAST:event_btnPesquisarActionPerformed

    private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed
        salvar();
    }//GEN-LAST:event_btnSalvarActionPerformed

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        cancelar();
    }//GEN-LAST:event_btnCancelarActionPerformed

    private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed
        dispose();
    }//GEN-LAST:event_btnSairActionPerformed

    private void jRGastriteUlceraSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRGastriteUlceraSimItemStateChanged
        ativarCampo(jRGastriteUlceraSim, txtGastriteUlcera);
    }//GEN-LAST:event_jRGastriteUlceraSimItemStateChanged

    private void jRArritimiaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRArritimiaSimItemStateChanged
        ativarCampo(jRArritimiaSim, txtArritimias);
    }//GEN-LAST:event_jRArritimiaSimItemStateChanged

    private void jRMiocardiopatiaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRMiocardiopatiaSimItemStateChanged
        ativarCampo(jRMiocardiopatiaSim, txtMiocardiopatias);
    }//GEN-LAST:event_jRMiocardiopatiaSimItemStateChanged

    private void jRCardiopCongenitaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRCardiopCongenitaSimItemStateChanged
        ativarCampo(jRCardiopCongenitaSim, txtCardiopCongenitas);
    }//GEN-LAST:event_jRCardiopCongenitaSimItemStateChanged

    private void jRAsmaBronquiteSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRAsmaBronquiteSimItemStateChanged
        ativarCampo(jRAsmaBronquiteSim, txtAsmaBronquite);
    }//GEN-LAST:event_jRAsmaBronquiteSimItemStateChanged

    private void jRDiabeteSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRDiabeteSimItemStateChanged
        ativarCampo(jRDiabeteSim, txtDiabetes);
    }//GEN-LAST:event_jRDiabeteSimItemStateChanged

    private void jRHipotiroidismoSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRHipotiroidismoSimItemStateChanged
        ativarCampo(jRHipotiroidismoSim, txtHipotiroidismo);
    }//GEN-LAST:event_jRHipotiroidismoSimItemStateChanged

    private void jRHipertireodismoSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRHipertireodismoSimItemStateChanged
        ativarCampo(jRHipertireodismoSim, txtHipertireodismo);
    }//GEN-LAST:event_jRHipertireodismoSimItemStateChanged

    private void jRTromboseSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRTromboseSimItemStateChanged
        ativarCampo(jRTromboseSim, txtTrombose);
    }//GEN-LAST:event_jRTromboseSimItemStateChanged

    private void jRHemorragiaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRHemorragiaSimItemStateChanged
        ativarCampo(jRHemorragiaSim, txtHemorragias);
    }//GEN-LAST:event_jRHemorragiaSimItemStateChanged

    private void jRAnemiaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRAnemiaSimItemStateChanged
        ativarCampo(jRAnemiaSim, txtAnemia);
    }//GEN-LAST:event_jRAnemiaSimItemStateChanged

    private void jRCirurgiaPreviaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRCirurgiaPreviaSimItemStateChanged
        ativarCampo(jRCirurgiaPreviaSim, txtCirurgiaPrevia);
    }//GEN-LAST:event_jRCirurgiaPreviaSimItemStateChanged

    private void jRAlergiaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRAlergiaSimItemStateChanged
        ativarCampo(jRAlergiaSim, txtAlergias);
    }//GEN-LAST:event_jRAlergiaSimItemStateChanged

    private void jRTabagismoSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRTabagismoSimItemStateChanged
        ativarCampo(jRTabagismoSim, txtTabagismo);
    }//GEN-LAST:event_jRTabagismoSimItemStateChanged

    private void jREtilismoSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jREtilismoSimItemStateChanged
        ativarCampo(jREtilismoSim, txtEtilismo);
    }//GEN-LAST:event_jREtilismoSimItemStateChanged

    private void jRMedicacaoSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRMedicacaoSimItemStateChanged
        ativarCampo(jRMedicacaoSim, txtMedicacoes);
    }//GEN-LAST:event_jRMedicacaoSimItemStateChanged

    private void jRAtividadeFisicaSimItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRAtividadeFisicaSimItemStateChanged
        ativarCampo(jRAtividadeFisicaSim, txtAtividadesFisicas);
    }//GEN-LAST:event_jRAtividadeFisicaSimItemStateChanged

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnEditar;
    private javax.swing.JButton btnExcluir;
    private javax.swing.JButton btnNovo;
    private javax.swing.JButton btnPesquisar;
    private javax.swing.JButton btnSair;
    private javax.swing.JButton btnSalvar;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup10;
    private javax.swing.ButtonGroup buttonGroup11;
    private javax.swing.ButtonGroup buttonGroup12;
    private javax.swing.ButtonGroup buttonGroup13;
    private javax.swing.ButtonGroup buttonGroup14;
    private javax.swing.ButtonGroup buttonGroup15;
    private javax.swing.ButtonGroup buttonGroup16;
    private javax.swing.ButtonGroup buttonGroup17;
    private javax.swing.ButtonGroup buttonGroup18;
    private javax.swing.ButtonGroup buttonGroup19;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.ButtonGroup buttonGroup5;
    private javax.swing.ButtonGroup buttonGroup6;
    private javax.swing.ButtonGroup buttonGroup7;
    private javax.swing.ButtonGroup buttonGroup8;
    private javax.swing.ButtonGroup buttonGroup9;
    private com.toedter.calendar.JDateChooser jDateCadastro;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabelAlergia;
    private javax.swing.JLabel jLabelAnemia;
    private javax.swing.JLabel jLabelArritimia;
    private javax.swing.JLabel jLabelAsmaBronquite;
    private javax.swing.JLabel jLabelCardiopCongenta;
    private javax.swing.JLabel jLabelCirurgiaPrevia;
    private javax.swing.JLabel jLabelCoagulopatia;
    private javax.swing.JLabel jLabelEtilismo;
    private javax.swing.JLabel jLabelHipertireoidismo;
    private javax.swing.JLabel jLabelHipotiroidismo;
    private javax.swing.JLabel jLabelMedicacao;
    private javax.swing.JLabel jLabelMicosesAfeccoesCutaneas;
    private javax.swing.JLabel jLabelMiocardiopatia;
    private javax.swing.JLabel jLabelPaciente;
    private javax.swing.JLabel jLabelTrombose;
    private javax.swing.JPanel jPanelBotoes;
    private javax.swing.JPanel jPanelPaciente;
    private javax.swing.JPanel jPanelPrincipal;
    private javax.swing.JPanel jPanelRestricoes;
    private javax.swing.JRadioButton jRAlergiaNao;
    private javax.swing.JRadioButton jRAlergiaSim;
    private javax.swing.JRadioButton jRAnemiaNao;
    private javax.swing.JRadioButton jRAnemiaSim;
    private javax.swing.JRadioButton jRArritimiaNao;
    private javax.swing.JRadioButton jRArritimiaSim;
    private javax.swing.JRadioButton jRAsmaBronquiteNao;
    private javax.swing.JRadioButton jRAsmaBronquiteSim;
    private javax.swing.JRadioButton jRAtividadeFisicaNao;
    private javax.swing.JRadioButton jRAtividadeFisicaSim;
    private javax.swing.JRadioButton jRCardiopCongenitaNao;
    private javax.swing.JRadioButton jRCardiopCongenitaSim;
    private javax.swing.JRadioButton jRCirurgiaPreviaNao;
    private javax.swing.JRadioButton jRCirurgiaPreviaSim;
    private javax.swing.JRadioButton jRCoagulopatiaNao;
    private javax.swing.JRadioButton jRCoagulopatiaSim;
    private javax.swing.JRadioButton jRDiabeteNao;
    private javax.swing.JRadioButton jRDiabeteSim;
    private javax.swing.JRadioButton jREtilismoNao;
    private javax.swing.JRadioButton jREtilismoSim;
    private javax.swing.JRadioButton jRGastriteUlceraNao;
    private javax.swing.JRadioButton jRGastriteUlceraSim;
    private javax.swing.JRadioButton jRHemorragiaNao;
    private javax.swing.JRadioButton jRHemorragiaSim;
    private javax.swing.JRadioButton jRHipertireodismoNao;
    private javax.swing.JRadioButton jRHipertireodismoSim;
    private javax.swing.JRadioButton jRHipotiroidismoNao;
    private javax.swing.JRadioButton jRHipotiroidismoSim;
    private javax.swing.JRadioButton jRMedicacaoNao;
    private javax.swing.JRadioButton jRMedicacaoSim;
    private javax.swing.JRadioButton jRMicoseAfeccaoCutaneaNao;
    private javax.swing.JRadioButton jRMicoseAfeccaoCutaneaSim;
    private javax.swing.JRadioButton jRMiocardiopatiaNao;
    private javax.swing.JRadioButton jRMiocardiopatiaSim;
    private javax.swing.JRadioButton jRTabagismoNao;
    private javax.swing.JRadioButton jRTabagismoSim;
    private javax.swing.JRadioButton jRTromboseNao;
    private javax.swing.JRadioButton jRTromboseSim;
    private javax.swing.JTextField txtAlergias;
    private javax.swing.JTextField txtAnemia;
    private javax.swing.JTextField txtArritimias;
    private javax.swing.JTextField txtAsmaBronquite;
    private javax.swing.JTextField txtAtividadesFisicas;
    private javax.swing.JTextField txtCardiopCongenitas;
    private javax.swing.JTextField txtCirurgiaPrevia;
    private javax.swing.JTextField txtCoagulopatias;
    private javax.swing.JTextField txtDiabetes;
    private javax.swing.JTextField txtEtilismo;
    private javax.swing.JTextField txtGastriteUlcera;
    private javax.swing.JTextField txtHemorragias;
    private javax.swing.JTextField txtHipertireodismo;
    private javax.swing.JTextField txtHipotiroidismo;
    private javax.swing.JTextField txtMedicacoes;
    private javax.swing.JTextField txtMicoses;
    private javax.swing.JTextField txtMiocardiopatias;
    private javax.swing.JTextField txtNomePaciente;
    private javax.swing.JTextField txtTabagismo;
    private javax.swing.JTextField txtTrombose;
    // End of variables declaration//GEN-END:variables
}